local hx__hunzheng = fk.CreateSkill {
  name = "hx__hunzheng",
}


hx__hunzheng:addEffect("viewas", {
  pattern = ".",
  prompt = "#hx__hunzheng",
  anim_type = "control",
  interaction = function(self, player)
    local all_names = Fk:getAllCardNames("btd")
    local names = player:getViewAsCardNames(hx__hunzheng.name, all_names)
    if #names == 0 then return end
    return UI.CardNameBox {choices = names, all_choices = all_names}
  end,
  handly_pile = true,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 or not self.interaction.data then return end
    local card = Fk:cloneCard(self.interaction.data)
    card:addSubcards(cards)
    card.skillName = hx__hunzheng.name
    return card
  end,
  after_use = function (self, player, use)
    if not player.dead then
      player:drawCards(1, hx__hunzheng.name)
    end
  end,
  enabled_at_play = function(self, player)
    return player:usedSkillTimes(hx__hunzheng.name) == 0
  end,
  enabled_at_response = function(self, player, response)
    return player:usedSkillTimes(hx__hunzheng.name) == 0
  end,
})

return hx__hunzheng
